/**
 * JAVACC DEMO 1.0
 * @Package com.apache.portal.thread  
 */
package com.apache.portal.thread;

import com.apache.portal.common.util.PortalPubFactory;
import com.apache.rpc.common.LoadRpcService;
import com.apache.tools.ConfigUtil;
import org.apache.log4j.Logger;

import java.util.HashMap;
import java.util.Map;

/**
 * description:  【aie项目特有】Scada对接定时任务
 * @author qihan 创建时间：2018-01-19  
 */
public class ScadaSynErpShebeiSchedulderJob implements ISchedulerJob {

	private Logger log = Logger.getLogger(ScadaSynErpShebeiSchedulderJob.class);
	private static transient boolean ScadaSynErpShebeiSchedulderJob = true;//线程执行标志

	public void run() {
		if (ScadaSynErpShebeiSchedulderJob) {
			try {
				ScadaSynErpShebeiSchedulderJob = false;
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("modelTypes", "s_sysParamManager");
				param.put("resultType", "processSql");
				param.put("sqlKeyId", "aie018");//aie018=（aie）中间表对接设备定时任务插件-ScadaSynErpShebeiPluginImpl
				param.put("sysPass",  ConfigUtil.getInstance().interfacePass());
				param.put("beforMethodKey", "aie018");
				LoadRpcService.service().doServiceClient("aiemesService", "dymicSql", param,
						PortalPubFactory.getInstance().getRpcInfo("ius"));
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				ScadaSynErpShebeiSchedulderJob = true;
			}
		}
	}
}
